package net.sk.china.city.talk.service.impl.city;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.sk.china.city.talk.dao.city.CityRoleDao;
import net.sk.china.city.talk.model.city.CityRole;
import net.sk.china.city.talk.service.city.CityRoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * CityServiceImpl 接口实现
 * +----------------------------------------------------------------------
 * | Talk To [ 聊来改善地区金融服务环境，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2018-2024 聊来All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed ( <a href="http://www.apache.org/licenses/LICENSE-2.0">apache</a> )
 * +----------------------------------------------------------------------
 * | @Author: 聊来 <18970881148@qq.com>
 * +----------------------------------------------------------------------
 * | DateTime: 2024/6/11 15:40
 * +----------------------------------------------------------------------
 */

@Service
public class CityRoleServiceImpl extends ServiceImpl<CityRoleDao, CityRole> implements CityRoleService {

    @Resource
    private CityRoleDao dao;

    /**
     * 获取所有角色
     * @return {@code List<CityRole>}
     */
    @Override
    public List<CityRole> getAllList() {
        LambdaQueryWrapper<CityRole> query = new LambdaQueryWrapper<>();
        query.eq(CityRole::getStatus, true);
        query.orderByAsc(CityRole::getId);

        return dao.selectList(query);
    }
}
